import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text("Form Demo"),
      ),
      body: InputStyleWidget(),
    ),
  ));
}

class InputStyleWidget extends StatefulWidget {
  @override
  _InputStyleWidgetState createState() => _InputStyleWidgetState();
}

class _InputStyleWidgetState extends State<InputStyleWidget> {

  @override
  Widget build(BuildContext context) {
    return const TextField(
      decoration: InputDecoration(
        labelText: "请输入用户名",
        prefixIcon: Icon(Icons.person),
        enabledBorder: UnderlineInputBorder(
          borderSide: BorderSide(color: Colors.grey),
        ),
        focusedBorder: UnderlineInputBorder(
          borderSide: BorderSide(color: Colors.blue),
        ),
      ),
    );
  }
}
